package mafiagame;

public class UnvoteMafiaAction extends Action
{
	Game myGame;
	Player myPlayer;
	public UnvoteMafiaAction(Game g, Player p)
	{
		myGame = g;
		myPlayer = p;
	}
	
	@Override
	public String getDescription()
	{
		return "This allows you to cancel your vote to mafiakill someone. Just type <b>unvote</b> and you'll get your vote back!";
	}

	@Override
	public String getCommand()
	{
		return "unvote";
	}

	@Override
	public boolean Execute(String message)
	{
		myPlayer.playerVote = -1;
		
		myGame.communicator.sendPrivateMessage(myPlayer.username, "Vote cancelled!");
		
		myGame.addAction(myPlayer.username, new MafiaAction(myGame, myPlayer), true);
		
		return true;
	}

	@Override
	public boolean isPublic()
	{
		return false;
	}

	@Override
	public void Resolve()
	{
		// This action should never actually be resolved.		
	}

}
